<div xmlns:ext="http://www.extjs.com" class="body-wrap"><h1>Class <a href="source/ToolbarDroppable.html#cls-Ext.ux.ToolbarDroppable">Ext.ux.ToolbarDroppable</a></h1><table cellspacing="0"><tr><td class="label">Package:</td><td class="hd-info">Ext.ux</td></tr><tr><td class="label">Defined In:</td><td class="hd-info"><a href="source/ToolbarDroppable.html#cls-Ext.ux.ToolbarDroppable">ToolbarDroppable.js</a></td></tr><tr><td class="label">Class:</td><td class="hd-info"><a href="source/ToolbarDroppable.html#cls-Ext.ux.ToolbarDroppable">ToolbarDroppable</a></td></tr><tr><td class="label">Extends:</td><td class="hd-info">Object</td></tr></table><div class="description">Plugin which allows items to be dropped onto a toolbar and be turned into new Toolbar items.
To use the plugin, you just need to provide a createItem implementation that takes the drop
data as an argument and returns an object that can be placed onto the toolbar. Example:
<pre>
new Ext.ux.ToolbarDroppable({
createItem: function(data) {
return new Ext.Button({text: data.text});
}
});
</pre>
The afterLayout function can also be overridden, and is called after a new item has been 
created and inserted into the Toolbar. Use this for any logic that needs to be run after
the item has been created.</div><div class="hr"></div><a id="Ext.ux.ToolbarDroppable-props"></a><h2>Public Properties</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Property</th><th class="msource-header">Defined By</th></tr><tr class="property-row  "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-afterLayout"></a><b><a href="source/ToolbarDroppable.html#prop-Ext.ux.ToolbarDroppable-afterLayout">afterLayout</a></b> : Object<div class="mdesc">Called after a new button has been created and added to the toolbar. Add any required cleanup logic here</div></td><td class="msource">ToolbarDroppable</td></tr><tr class="property-row  "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-dropTarget"></a><b><a href="source/ToolbarDroppable.html#prop-Ext.ux.ToolbarDroppable-dropTarget">dropTarget</a></b> : Ext.dd.DropTarget
The drop target attached to the toolbar instance<div class="mdesc"></div></td><td class="msource">ToolbarDroppable</td></tr><tr class="property-row  "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-toolbar"></a><b><a href="source/ToolbarDroppable.html#prop-Ext.ux.ToolbarDroppable-toolbar">toolbar</a></b> : Ext.Toolbar
The toolbar instance that this plugin is tied to<div class="mdesc"></div></td><td class="msource">ToolbarDroppable</td></tr></tbody></table><a id="Ext.ux.ToolbarDroppable-methods"></a><h2>Public Methods</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Method</th><th class="msource-header">Defined By</th></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-addDDGroup"></a><b class="method"><a href="source/ToolbarDroppable.html#method-Ext.ux.ToolbarDroppable-addDDGroup">addDDGroup</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">String&nbsp;ddGroup</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Adds the given DD Group to the drop target</div><div class="long">Adds the given DD Group to the drop target<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>ddGroup</code> : String<div class="sub-desc">The DD Group</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">ToolbarDroppable</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-calculateEntryIndex"></a><b class="method"><a href="source/ToolbarDroppable.html#method-Ext.ux.ToolbarDroppable-calculateEntryIndex">calculateEntryIndex</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">Ext.EventObject&nbsp;e</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">Number</span><div class="mdesc"><div class="short">Calculates the location on the toolbar to create the new sorter button based on the XY of the
drag event</div><div class="long">Calculates the location on the toolbar to create the new sorter button based on the XY of the
drag event<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>e</code> : Ext.EventObject<div class="sub-desc">The event object</div></li></ul><strong>Returns:</strong><ul><li><code>Number</code><div class="sub-desc">The index at which to insert the new button</div></li></ul></div></div></div></td><td class="msource">ToolbarDroppable</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-canDrop"></a><b class="method"><a href="source/ToolbarDroppable.html#method-Ext.ux.ToolbarDroppable-canDrop">canDrop</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">Object&nbsp;data</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">Boolean</span><div class="mdesc"><div class="short">Returns true if the drop is allowed on the drop target. This function can be overridden
and defaults to simply return...</div><div class="long">Returns true if the drop is allowed on the drop target. This function can be overridden
and defaults to simply return true<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>data</code> : Object<div class="sub-desc">Arbitrary data from the drag source</div></li></ul><strong>Returns:</strong><ul><li><code>Boolean</code><div class="sub-desc">True if the drop is allowed</div></li></ul></div></div></div></td><td class="msource">ToolbarDroppable</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-constructor"></a><b class="method"><a href="source/ToolbarDroppable.html#method-Ext.ux.ToolbarDroppable-constructor">constructor</a></b><span class="openparen">(</span><span class="closeparen">)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short"></div><div class="long"><div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">ToolbarDroppable</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-createDropTarget"></a><b class="method"><a href="source/ToolbarDroppable.html#method-Ext.ux.ToolbarDroppable-createDropTarget">createDropTarget</a></b><span class="openparen">(</span><span class="closeparen">)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Creates a drop target on the toolbar</div><div class="long">Creates a drop target on the toolbar<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">ToolbarDroppable</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-createItem"></a><b class="method"><a href="source/ToolbarDroppable.html#method-Ext.ux.ToolbarDroppable-createItem">createItem</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">Object&nbsp;data</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">Mixed</span><div class="mdesc"><div class="short">Creates the new toolbar item based on drop data. This method must be implemented by the plugin instance</div><div class="long">Creates the new toolbar item based on drop data. This method must be implemented by the plugin instance<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>data</code> : Object<div class="sub-desc">Arbitrary data from the drop</div></li></ul><strong>Returns:</strong><ul><li><code>Mixed</code><div class="sub-desc">An item that can be added to a toolbar</div></li></ul></div></div></div></td><td class="msource">ToolbarDroppable</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-init"></a><b class="method"><a href="source/ToolbarDroppable.html#method-Ext.ux.ToolbarDroppable-init">init</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">Ext.Toolbar&nbsp;toolbar</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Initializes the plugin and saves a reference to the toolbar</div><div class="long">Initializes the plugin and saves a reference to the toolbar<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>toolbar</code> : Ext.Toolbar<div class="sub-desc">The toolbar instance</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">ToolbarDroppable</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-notifyDrop"></a><b class="method"><a href="source/ToolbarDroppable.html#method-Ext.ux.ToolbarDroppable-notifyDrop">notifyDrop</a></b><span class="openparen">(</span><span class="closeparen">)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Called when the drop has been made. Creates the new toolbar item, places it at the correct location
and calls the aft...</div><div class="long">Called when the drop has been made. Creates the new toolbar item, places it at the correct location
and calls the afterLayout callback.<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">ToolbarDroppable</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-notifyOver"></a><b class="method"><a href="source/ToolbarDroppable.html#method-Ext.ux.ToolbarDroppable-notifyOver">notifyOver</a></b><span class="openparen">(</span><span class="closeparen">)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">String</span><div class="mdesc"><div class="short">Custom notifyOver method which will be used in the plugin's internal DropTarget</div><div class="long">Custom notifyOver method which will be used in the plugin's internal DropTarget<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li><code>String</code><div class="sub-desc">The CSS class to add</div></li></ul></div></div></div></td><td class="msource">ToolbarDroppable</td></tr></tbody></table><a id="Ext.ux.ToolbarDroppable-events"></a><h2>Public Events</h2><div class="no-members">This class has no public events.</div></div>